<template>
	<view>
		<view class="status_bar"></view>
		
		<web-view :src="domHtml" @message="message" @onPostMessage="onPostMessage"></web-view>
		<!-- <web-view src="https://099918.kefu.easemob.com/webim/im.html?configId=dd01ef4a-0e08-44e3-9756-7a5fd43170bd"></web-view> -->
	</view>
</template>

<script>
	import httpUrl from '@/config/index.config.js'
	export default {
			
		data(){
			return {
				domHtml:''
			}
		},
		onLoad(params) {
			console.log(params);
			const options = JSON.parse(params.option);
			console.log(options);
			this.domHtml = httpUrl.identityUrl+"Account/QrCodeSign?"+`idsOpenid=${options.openId}&qrdata=${encodeURIComponent(options.qrdata)}&sign=${options.sign}`;
			// this.domHtml = '/hybrid/html/local.html'
			// this.domHtml = 'https://ids.chinabev.com/uni.html'
			
		},
		methods:{
			message(msg){
				console.log(msg);
				if(msg === 'success'){
					uni.navigateBack();
				}
			},
			onPostMessage(msg){
				console.log(msg);
			}
		}
		
	}
</script>

<style scoped lang="scss">
	.status_bar {
		height: var(--status-bar-height);
		background-color: $theme-color;
		width: 100%;
	}
</style>
